/**
 * This file is a part of qloudgen-sec. 
 * You can redistribute qloudgen-sec and/or modify it under the terms of the Lesser GNU General Public License version 3. 
 * qloudgen-sec is distributed WITHOUT ANY WARRANTY. 
 *
 * See the Lesser GNU General Public License for more details at http://www.gnu.org/licenses/. 
 **/
package org.qloudgen.sec.osgi.shiro.authc;

import java.util.Map;

/**
 * <p>Title: Authentication Service for OSGi</p>
 * <p>Description: Define authentication service for osgi container.</p>
 * <p>Copyright: qloudgen/sec 2014</p>
 * @author <a href="mailto:hyq.dd.sun@gmail.com">glue.3M</a>
 */
public interface AuthenticationService {
	/**
	 * Login.
	 *
	 * @param ticket
	 */
	public void login(String ticket);
	
	/**
	 * Logout.
	 *
	 * @param ticket
	 */
	public void logout(String ticket);
	
	/**
	 * Test
	 *
	 * @param ticket
	 * @return boolean
	 */
	public boolean isAuthenticated(String ticket);
	
	/**
	 * Returns current user id after authentication..
	 *
	 * @param ticket
	 * @return String
	 */
	public String getUserId(String ticket);
	
	/**
	 * Returns current user attributes after authentication.
	 *
	 * @param ticket
	 * @return Map<String,Object>
	 */
	public Map<String,Object> getUserAttributes(String ticket);
	
	/**
	 *
	 */
	public final static String PID = "authentication";
	/**
	 *
	 */
	public final static String DESCRIPTION = "Authentication service based apache shiro and jasig cas.";
	/**
	 *
	 */
	public final static String VENDOR = "qloudgen";
}